package com.xiake.utils;

import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;

public class SMSUtil {
	private static final String url = "http://222.73.117.158/msg/HttpBatchSendSM";
	private static final String account = "fzn-01";
	private static final String pswd = "Txb123456";

	public static String send(String mobile, String content) {
		String result = "";
		try {
			Map<String, String> params = new HashMap<>();
			params.put("account", account);
			params.put("pswd", pswd);
			params.put("mobile", mobile);
			System.out.println(URLEncoder.encode(content, "UTF-8"));
			params.put("msg", URLEncoder.encode(content, "UTF-8"));
			params.put("needstatus", "false");
			result = HttpUtil.get(url, params);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	
	public static void main(String[] args) {
		String result = send("18600441896", "验证码是5698741");
		System.out.println(result);
	}
}
